import torchvision.models as models
from ptflops import get_model_complexity_info

net=models.vgg16()
flops,params = get_model_complexity_info(net,(3,224,224),as_strings=True,print_per_layer_stat=True)
print('FLOPs:{}'.format(flops))
print('Params:{}'.format(params))